'''
Created on 2012-12-26

@author: Administrator
'''
from django.db import models

# Create your models here.

class moduleTable(models.Model):
    name = models.CharField(max_length =50)
    jsonKey=models.CharField(max_length =50)
    fieldType=models.CharField(max_length =50)
    code = models.CharField(max_length =2000)
    content = models.CharField(max_length =2000)
    version = models.CharField(max_length =100)
    createDate = models.DateField(auto_now_add=True)
    modifyDate = models.DateField(auto_now=True)
    
    def __getitem__(self,name):
        return self.__getattribute__(name)
    
    def setAttr(self,name,value):
        self.__setattr__(name,value)
        

class Component(models.Model):
    name = models.CharField(max_length =30)
    jsonKey=models.CharField(max_length =50)
    remark = models.CharField(max_length =200)
    content = models.CharField(max_length =500)
    createDate = models.DateField(auto_now_add=True)
    modifyDate = models.DateField(auto_now=True)
    
    def __getitem__(self,name):
        return self.__getattribute__(name)
    
    def setAttr(self,name,value):
        self.__setattr__(name,value)     
        
class Base():
    def __getitem__(self,name):
        return self.__getattribute__(name)
    
    def setAttr(self,name,value):
        self.__setattr__(name,value)  

class JsonLog(Base,models.Model):
    name = models.CharField(max_length =200)
    content = models.TextField()     
    modifyDate = models.DateField(auto_now=True) 
      
class Html(models.Model):
    name = models.CharField(max_length =30)
    path=models.CharField(max_length =200)
    remark = models.CharField(max_length =200)
    copyId = models.CharField(max_length =200)
    rightId = models.CharField(max_length =200)
    formId = models.CharField(max_length =200)
    createDate = models.DateField(auto_now_add=True)
    modifyDate = models.DateField(auto_now=True)
    type=models.CharField(max_length =30)
    def __getitem__(self,name):
        return self.__getattribute__(name)
    
    def setAttr(self,name,value):
        self.__setattr__(name,value)       
        
class Project(Base,models.Model):
    name=models.CharField(max_length =100)
    url=models.CharField(max_length =500)
    path = models.CharField(max_length =100)
    type = models.CharField(max_length =100) 
        
class Field(models.Model):
    field=models.CharField(max_length =100)
    key = models.CharField(max_length =100)
    text = models.CharField(max_length =100)
    def __getitem__(self,name):
        return self.__getattribute__(name)
    
    def setAttr(self,name,value):
        self.__setattr__(name,value)  
        
class PlanAndSchedu(Base,models.Model):
    id=models.AutoField(primary_key=True)
    name=models.CharField(max_length =100)
    content = models.TextField()
    priority = models.CharField(max_length =100)
    schedule= models.CharField(max_length =100)

class Service(Base,models.Model):
    name=models.CharField(max_length =100)
    path=models.CharField(max_length =100)
    package = models.CharField(max_length =100)
    owner_pro = models.IntegerField()
    remark = models.TextField()
    
class RelaForm(Base,models.Model):
    project_id=models.IntegerField()
    form_id=models.IntegerField()

class ProParam(Base,models.Model):
    pro_id=models.IntegerField()
    content=models.TextField()
    webRoot=models.CharField(max_length =100)
    login=models.CharField(max_length =500)
    
class Table(Base,models.Model):
    name=models.CharField(max_length =100)
    remark=models.CharField(max_length =500)
    fields=models.TextField()
    package=models.CharField(max_length =100)

class RelaBean(Base,models.Model):
    project_id=models.IntegerField()
    bean_id=models.IntegerField() 
    
    